<?php

namespace App\Http\Model\PtProv;

use App\Http\Model\PtTheme;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;


use Log;
/*
 * 乡村
 */
class PtVillage extends Model {

    protected $table = 'pt_village';
	protected $guarded = [];

    //关联到城市表
    public function prov()
    {
        return $this->hasOne(PtProv::class,'id', 'prov_id');
    }

    //关联到城市表
    public function city()
    {
        return $this->hasOne(PtCity::class,'id', 'city_id');
    }

    //关联到县份表
    public function county()
    {
        return $this->hasOne(PtCounty::class,'id','county_id');
    }

    public function theme()
    {
        return $this->belongsTo(PtTheme::class,'pt_theme_id');
    }
}
